local priority = 6

EntitySystem.updatesystem("onDeath", priority, function(dt) 
     
  for e in pairs(EntitySystem.query("death")) do
    if e.onDeath.needsRun and not e.onDeath.hasRun then
      e.onDeath.action(e)
    end
  end
end)